package com.ericsson.common.pojo;


import java.text.ParseException;
import java.text.SimpleDateFormat;

public class CdrDownVo {

	private String netName;
	private long loadFileModifyTime;
	
	private String fileName;
	
	private long timeAndNum;
	
	private long temp1;
	private long temp2;
	private long temp3;
	private long temp4;
	private String factory;

	public String getFactory() {
		return factory;
	}

	public void setFactory(String factory) {
		this.factory = factory;
	}

	public long getTemp3() {
		return temp3;
	}

	public void setTemp3(long temp3) {
		this.temp3 = temp3;
	}

	public long getTemp1() {
		return temp1;
	}

	public void setTemp1(long temp1) {
		this.temp1 = temp1;
	}

	public long getTemp2() {
		return temp2;
	}

	public void setTemp2(long temp2) {
		this.temp2 = temp2;
	}

	public long getLoadFileModifyTime() {
		return loadFileModifyTime;
	}

	public void setLoadFileModifyTime(long loadFileModifyTime) {
		this.loadFileModifyTime = loadFileModifyTime;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		if(fileName!=null&&!fileName.equals("")){
			this.fileName = fileName;
			String[] subStr = fileName.replace(".dat","").replace(".gz","").toUpperCase().split(":");
			String[] sub_ = subStr[1].split("_");
			this.timeAndNum = Long.parseLong(sub_[sub_.length-2].substring(2) + String.format("%06d", Long.valueOf(sub_[sub_.length-1])));
		}
	}
	
	public void setHWFileName(String fileName) {
		this.fileName = fileName;
		String[] sub_ = fileName.toUpperCase().split("_");
		this.timeAndNum = Long.parseLong(sub_[sub_.length-1].split("\\.")[0]);
	}

	public void setVGCFileName(String fileName) throws ParseException {
		if(fileName!=null&&!fileName.equals("")){
			if(fileName.contains("CDF")) {
				this.fileName = fileName;
				String[] subStr = fileName.replace(".ber", "").replace(".gz", "").toUpperCase().split("_");
				this.loadFileModifyTime = (new SimpleDateFormat("yyyyMMddHHmmSS").parse(subStr[2])).getTime();
				this.timeAndNum = Long.parseLong(subStr[2].substring(2) + String.format("%06d", Long.valueOf(subStr[3])));
			}else{
				this.fileName = fileName;
				String[] subStr = fileName.replace(".dat","").replace(".gz","").toUpperCase().split("_");
				this.loadFileModifyTime = (new SimpleDateFormat("yyyyMMddHHmmSS").parse(subStr[4])).getTime();
				this.timeAndNum = Long.parseLong(subStr[4].substring(2) + String.format("%06d", Long.valueOf(subStr[5])));
			}
		}
	}
	
	public long getTimeAndNum() {
		return timeAndNum;
	}

	public void setTimeAndNum(long timeAndNum) {
		this.timeAndNum = timeAndNum;
	}

	public long getTemp4() {
		return temp4;
	}

	public void setTemp4(long temp4) {
		this.temp4 = temp4;
	}

	public String getNetName() {
		return netName;
	}

	public void setNetName(String netName) {
		this.netName = netName;
	}
}
